package ro.ubbcluj.cs.damate.persistence.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ro.ubbcluj.cs.damate.persistence.entities.Team;

import java.util.List;

/**
 * @author Lóránd Fazakas (lorand)
 *         Date: 5/10/12
 *         Time: 9:25 PM
 */
public interface TeamRepository extends CrudRepository<Team, Long> {

    @Query("select e from Team e ")
    List<Team> findAll();
    @Query("select distinct e from Team e left join fetch e.members")
    List<Team> findAllWithMembers();
}
